<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2020/10/30
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <form method="post" action="${pageContext.request.contextPath}/User/User_login" onsubmit="return checksubmit()">
            <table align="center">
                <tr>
                    <br>
                        <h2>小型进销存系统</h2>
                        账号:<input type="text" name="name" onblur="x()" id="names"/></br>
                        密码:<input type="password" name="pwd" onblur="c()" id="pwds"/></br>
                        <input type="submit" value="登录" align="center"/>
                    </td>
                </tr>
            </table>
        </form>
<script type="text/javascript"  src="${pageContext.request.contextPath}/js/jquery-1.11.1.js"></script>
<script type="text/javascript">
     function x() {
         var c=$("#names").val()
         if (c.length==0&c==""){
             alert('账号不能为空')
             return false;
         }else{
           return true;
         }
     }
     function c() {
         var pwd = $("#pwds").val()
         console.log(pwd)
         if (pwd==""&pwd.length==0){
             alert('密码不能为空')
             return false;
         } else{
             return true;
         }
     }
     function  checksubmit() {
         return x()&c();
     }
</script>
</body>
</html>
